package com.poker.repository;

import com.poker.entity.ActivityUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


@Repository
public interface ActivityUserRepository extends JpaRepository<ActivityUser,String>, JpaSpecificationExecutor<ActivityUser> {
    @Query(value = "select *  from activity_user where activity_id=(?1) and  user_number >= (SELECT MAX(user_number) FROM activity_user WHERE activity_id= (?1) )",nativeQuery = true)
    ActivityUser findListByActivityId(String activityId);
}
